CC = tcc

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

INCS = -I${X11INC}
LIBS = -L${X11LIB} -lX11

CFLAGS = -Wall -Wextra -pedantic -Wwrite-strings ${INCS}
LDFLAGS = ${LIBS}

SRC=$(wildcard modules/*.c) status.c
OBJ=$(patsubst %.c, %.o, $(SRC))

all: status

status: $(OBJ)
	$(CC) -o $@ $(OBJ) $(LDFLAGS)

$(filter %.o, $(OBJ)): %.o : %.c
	$(CC) $(CFLAGS) -c $< -o $@

install: status
	cp -f status /usr/local/bin/status

clean:
	@echo $(OBJ)
	rm -f $(OBJ) status
